package org.thoughtworks.selenium.flex.ui;

import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;

public class AutomationIdMap<K, V> extends LinkedHashMap<K, V> {
    public String toString() {
        Iterator<Map.Entry<K, V>> i = entrySet().iterator();
        if (!i.hasNext())
            return "{}";

        StringBuilder sb = new StringBuilder();
        int j=0;
        for (; ;) {
            Map.Entry<K, V> e = i.next();
            K key = e.getKey();
            V value = e.getValue();
            sb.append(key == this ? "(this Map)" : key);
            sb.append('{');
            sb.append(value == this ? "(this Map)" : value);
            sb.append(" string}");
            if (!i.hasNext())
                return sb.toString();
            else
                sb.append(" ");
        }

    }
}
